package com.dykj.fireFighting.web.base.websocket.configure;

import com.dykj.fireFighting.common.starter.redisson.service.RedisService;
import com.dykj.fireFighting.web.base.websocket.CommonWebSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;


/**
 * @author JacksonTu
 * @Description websocket配置
 * @date 2018/6/28 19:44
 */
@Configuration
public class WebSocketConfigure {
    /**
     * 打成war包,Tomcat运行时需注释掉
     *
     * @return
     */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    @Autowired
    public void setRedisService(RedisService redisService)
    {
        CommonWebSocket.redisService=redisService;
    }

}
